package com.heima.day527_方法;

public class ArrayBL {
    /*数组遍历
    1.显示0-10，调用方法，不换行打印结果
    2.定义静态数组{6,8,10,12},调用方法
    print打印不换行
     */
    public static void main(String[] args) {
        numa();
        int[] arr = {1,2,3,4,5,6};
        numb(arr);
    }


    public static void numa() {
        System.out.print("[");
        for (int i = 0; i <= 10; i++) {
            if (i == 10) {
                System.out.println(i + "]");
            } else {
                System.out.print(i + ",");
            }
        }
    }

    public static void numb(int[] arr) {
        System.out.print("[");
        for (int i = 0; i <=arr.length; i++) {
            if (arr[i]==arr.length){
                System.out.println(arr[i]+"]");
            }else {
                System.out.print(arr[i]+",");
            }
        }
    }


}
